<template>
  <div id="app">
    <div class="main">
      <!-- 路由视图 -->
      <router-view @get-player-id="getPlayerId" @get-play-all-id="getPlayAllId"></router-view>
      <!-- 播放器组件 -->
      <player v-show="playerId" :player-id="playerId" :list-id="listId" @set-player-id="setPlayerId" :playtype="playtype"></player>
    </div>
  </div>
</template>

<script>
import player from "./components/base/player.vue"
export default {
  data(){
    return {
      playerId:null,
      listId:null,
      playtype:false,
    }
  },
  methods:{
    // 获取子组件播放歌曲id
    getPlayerId(id){
      console.log("歌曲id",id);
      this.playerId = id;
    },
    getPlayAllId(id){
      this.listId = id;
    },
    setPlayerId(id){
      this.playerId = id;
    }
  },
  components:{
    player
  }
}
</script>

<style lang="less">
@import "./assets/css/base.css";



</style>